# -*- coding:utf-8 -*-

import BigWorld
import pydebug
import GUI

from gbref import rds
from gbref import setCursor
import Define
from StatusMgr import StatusMgr
from CameraMgr import CameraMgr
from ControlObjMgr import ControlObjMgr


def init( scriptsConfig, engineConfig, userPreferences, loadingScreenGUI = None ):
	pydebug.DEBUG_MSG( "" )
	rds.loadingScreenGUI  = loadingScreenGUI
	rds.statusMgr = StatusMgr.instance()
	rds.cameraMgr = CameraMgr.instance()
	rds.controlObjMgr = ControlObjMgr.instance()
	
def start():
	pydebug.DEBUG_MSG( "" )
	BigWorld.setCustomProgress( 1 )	
	setCursor( "arrow" )
	rds.statusMgr.changeStatus( Define.GAME_STATUS_INIT )
	

def onChangeEnvironments( inside ):
	pydebug.DEBUG_MSG( "" )
	

def onEngineInitialized() :
	pydebug.DEBUG_MSG( "" )
	
# --------------------------------------------------------------------
# Method: handleKeyEvent
# Description:
#	- This is called by BigWorld when a key is pressed.
# --------------------------------------------------------------------
def handleKeyEvent( isDown, key, mods ):
	return rds.statusMgr.handleKeyEvent( isDown, key, mods )
	
# --------------------------------------------------------------------
# Method: handleMouseEvent
# Description:
#	- This is called by BigWorld when a mouse event is generated.
# --------------------------------------------------------------------
def handleMouseEvent( dx, dy, dz ):
	return rds.statusMgr.handleMouseEvent( dx, dy, dz )
	
# --------------------------------------------------------------------
# Method: handleAxisEvent
# Description:
#    - This is called by BigWorld when ana axis event is generated.
# --------------------------------------------------------------------
def handleAxisEvent( axis, value, dTime ):
	return rds.statusMgr.handleAxisEvent( axis, value, dTime )
	